
import request from '@/utils/request'
// 获取权限列表
export function getPermission(params) {
  return request({
    url: '/permissions',
    method: 'get',
    params

  })
}
// 获取权限数量
export function getPermissionCount() {
  return request({
    url: '/permissions/count',
    method: 'get'

  })
}
// 获取指定权限
export function getOnlyPermission(id) {
  return request({

    url: `/permissions/${id}`,
    method: 'get'

  })
}
// 编辑权限
export function editPermission(data) {
  return request({

    url: `/permissions/${data.id}`,
    method: 'put',
    data

  })
}
// 添加权限
export function addPermission(data) {
  return request({

    url: '/permissions',
    method: 'post',
    data

  })
}
// 删除权限
export function deletePermission(id) {
  return request({

    url: `/permissions/${id}`,
    method: 'delete'

  })
}
